Add patch for strcmp
authorJochen Sprickerhof <git@jochen.sprickerhof.de>
Tue, 21 Apr 2020 17:29:15 +0000 (19:29 +0200)
committerJochen Sprickerhof <git@jochen.sprickerhof.de>
Tue, 21 Apr 2020 17:29:15 +0000 (19:29 +0200)
Closes: #957304
debian/patches/0014-Use-strncmp-to-compare-array-to-string.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/0014-Use-strncmp-to-compare-array-to-string.patch b/debian/patches/0014-Use-strncmp-to-compare-array-to-string.patch
new file mode 100644 (file)
index 0000000..76e5549
--- /dev/null
@@ -0,0 +1,27 @@
+From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
+Date: Tue, 21 Apr 2020 19:28:49 +0200
+Subject: Use strncmp to compare array to string
+
+---
+ v900.cc | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/v900.cc b/v900.cc
+index 775b963..91c233b 100644
+--- a/v900.cc
++++ b/v900.cc
+@@ -328,11 +328,11 @@ v900_read()
+       wpt->pdop = atof(line.adv.pdop);
+       /* handle fix mode (2d, 3d, etc.) */
+-      if (!strcmp(line.adv.valid,"DGPS")) {
++      if (!strncmp(line.adv.valid,"DGPS", sizeof line.adv.valid)) {
+         wpt->fix = fix_dgps;
+-      } else if (!strcmp(line.adv.fixmode,"3D")) {
++      } else if (!strncmp(line.adv.fixmode,"3D", sizeof line.adv.fixmode)) {
+         wpt->fix = fix_3d;
+-      } else if (!strcmp(line.adv.fixmode,"2D")) {
++      } else if (!strncmp(line.adv.fixmode,"2D", sizeof line.adv.fixmode)) {
+         wpt->fix = fix_2d;
+       } else
+         /* possible values: fix_unknown,fix_none,fix_2d,fix_3d,fix_dgps,fix_pps */
index f9753b992631f04355c4806f555ef37d48ee037b..abe2e67a34bc21bdc39fa2a614fe01a2b1002097 100644 (file)
@@ -11,3 +11,4 @@ htmldoc-location
 cross.patch
 0012-The-lezyne-super-gps-every-10th-ride-or-so-outputs-a.patch
 gmapbase.html-location
+0014-Use-strncmp-to-compare-array-to-string.patch